package org.feiye.studyday28;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Mysocket {

	public static void main(String[] args) {
		try {
			ServerSocket st = new ServerSocket(7777);
			System.out.println("服务端启动中。。。");
			while (true) {
				Socket s = st.accept();
				System.out.println("本机地址" + s.getLocalAddress() + "端口号：" + s.getLocalPort());
				System.out.println("远程地址" + s.getInetAddress() + "端口号：" + s.getPort());
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
